\(\int \frac {1}{(-2+x) \sqrt {2+x}} \, dx\) [1453]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 14 \[ \int \frac {1}{(-2+x) \sqrt {2+x}} \, dx=-\text {arctanh}\left (\frac {\sqrt {2+x}}{2}\right ) \]

[Out]

-arctanh(1/2*(2+x)^(1/2))

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {65, 213} \[ \int \frac {1}{(-2+x) \sqrt {2+x}} \, dx=-\text {arctanh}\left (\frac {\sqrt {x+2}}{2}\right ) \]

[In]

Int[1/((-2 + x)*Sqrt[2 + x]),x]

[Out]

-ArcTanh[Sqrt[2 + x]/2]

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rubi steps \begin{align*} \text {integral}& = 2 \text {Subst}\left (\int \frac {1}{-4+x^2} \, dx,x,\sqrt {2+x}\right ) \\ & = -\tanh ^{-1}\left (\frac {\sqrt {2+x}}{2}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00 \[ \int \frac {1}{(-2+x) \sqrt {2+x}} \, dx=-\text {arctanh}\left (\frac {\sqrt {2+x}}{2}\right ) \]

[In]

Integrate[1/((-2 + x)*Sqrt[2 + x]),x]

[Out]

-ArcTanh[Sqrt[2 + x]/2]

Maple [A] (verified)

Time = 0.48 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.50

method result size
trager \(-\frac {\ln \left (-\frac {6+x +4 \sqrt {2+x}}{-2+x}\right )}{2}\) \(21\)
derivativedivides \(-\frac {\ln \left (\sqrt {2+x}+2\right )}{2}+\frac {\ln \left (\sqrt {2+x}-2\right )}{2}\) \(22\)
default \(-\frac {\ln \left (\sqrt {2+x}+2\right )}{2}+\frac {\ln \left (\sqrt {2+x}-2\right )}{2}\) \(22\)

[In]

int(1/(-2+x)/(2+x)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2*ln(-(6+x+4*(2+x)^(1/2))/(-2+x))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 21 vs. \(2 (10) = 20\).

Time = 0.22 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.50 \[ \int \frac {1}{(-2+x) \sqrt {2+x}} \, dx=-\frac {1}{2} \, \log \left (\sqrt {x + 2} + 2\right ) + \frac {1}{2} \, \log \left (\sqrt {x + 2} - 2\right ) \]

[In]

integrate(1/(-2+x)/(2+x)^(1/2),x, algorithm="fricas")

[Out]

-1/2*log(sqrt(x + 2) + 2) + 1/2*log(sqrt(x + 2) - 2)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 26 vs. \(2 (10) = 20\).

Time = 0.44 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.86 \[ \int \frac {1}{(-2+x) \sqrt {2+x}} \, dx=\begin {cases} - \operatorname {acoth}{\left (\frac {\sqrt {x + 2}}{2} \right )} & \text {for}\: \left |{x + 2}\right | > 4 \\- \operatorname {atanh}{\left (\frac {\sqrt {x + 2}}{2} \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(1/(-2+x)/(2+x)**(1/2),x)

[Out]

Piecewise((-acoth(sqrt(x + 2)/2), Abs(x + 2) > 4), (-atanh(sqrt(x + 2)/2), True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 21 vs. \(2 (10) = 20\).

Time = 0.22 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.50 \[ \int \frac {1}{(-2+x) \sqrt {2+x}} \, dx=-\frac {1}{2} \, \log \left (\sqrt {x + 2} + 2\right ) + \frac {1}{2} \, \log \left (\sqrt {x + 2} - 2\right ) \]

[In]

integrate(1/(-2+x)/(2+x)^(1/2),x, algorithm="maxima")

[Out]

-1/2*log(sqrt(x + 2) + 2) + 1/2*log(sqrt(x + 2) - 2)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 22 vs. \(2 (10) = 20\).

Time = 0.31 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.57 \[ \int \frac {1}{(-2+x) \sqrt {2+x}} \, dx=-\frac {1}{2} \, \log \left (\sqrt {x + 2} + 2\right ) + \frac {1}{2} \, \log \left ({\left | \sqrt {x + 2} - 2 \right |}\right ) \]

[In]

integrate(1/(-2+x)/(2+x)^(1/2),x, algorithm="giac")

[Out]

-1/2*log(sqrt(x + 2) + 2) + 1/2*log(abs(sqrt(x + 2) - 2))

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.71 \[ \int \frac {1}{(-2+x) \sqrt {2+x}} \, dx=-\mathrm {atanh}\left (\frac {\sqrt {x+2}}{2}\right ) \]

[In]

int(1/((x - 2)*(x + 2)^(1/2)),x)

[Out]

-atanh((x + 2)^(1/2)/2)